package com.black.web.controller.appuser;

import com.black.app.domain.AppUserLevel;
import com.black.app.service.AppUserLevelService;
import com.black.common.core.controller.BaseController;
import com.black.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "后台-用户会员等级管理Api")
@RestController
@RequestMapping("/admin/appuser/level")
public class AdminUserLevelController extends BaseController {


    @Autowired
    private AppUserLevelService appUserLevelService;
    /**
     * 获取所有等级名称
     */
    @ApiOperation(value = "获取所有等级名称")
    @PreAuthorize("@ss.hasPermi('appuser:level:list')")
    @GetMapping("/allName")
    public R<List<AppUserLevel>> getAllLevelName() {
        List<AppUserLevel> allLevelName = appUserLevelService.getAllLevelName();
        return R.ok(allLevelName);
    }
}
